package com.blog.dao;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

import com.blog.domain.IbatisTest;

@Repository
public class TestDAO extends SqlMapClientDaoSupport{

    public List<String> selectAll(){
    	List<String> list = getSqlMapClientTemplate().queryForList("test.selectAll");
    	System.out.println(list);
    	return list;
    }
    
    public int selectMCodeMax(){
    	int max = (Integer) getSqlMapClientTemplate().queryForObject("test.selectMCodeMax");
    	return max+1;
    }
    
    public void insertAll(IbatisTest dto){
    	getSqlMapClientTemplate().insert("test.insertAll", dto);
    }
}
